//
//  Message.h
//  SouthChina
//
//  Created by creator_lq on 14/12/4.
//  Copyright (c) 2014年 科创. All rights reserved.
//

#define MEDIATYPE_AUDIO @"audio"
#define MEDIATYPE_VIDEO @"video"//不管
#define MEDIATYPE_FACEIMAGE @"faceimage" //不管
#define MEDIATYPE_PICTURE @"picture"
#define MEDIATYPE_TEXT @"text"
#define MEDIATYPE_NEWS @"news"
#define MEDIATYPE_URL @"url"
#define MEDIATYPE_SIGN @"sign"

///** 点对点消息（个人对个人，个人对公众号） */
#define MESSAGE_TYPE_P2P @"p2p"
///** 点对群消息（个人对虚拟群组） */
#define MESSAGE_TYPE_P2G @"p2g"
///** 好友验证 */
#define MESSAGE_TYPE_FRIEND @"friendValidate"
//邀请入群消息
#define SEND_JOIN_GRP_REQUEST @"sendJoinGrpRequest"
//申请入群
#define APPLY_TO_JOIN_GROUP @"applyToJoinGrp"
///** 命令消息（新版本，强制登陆等） */
#define MESSAGE_TYPE_CMD @"cmd"


#import "ORMRecord.h"

#define MSG_ID @"id"
#define RECEIVEID @"receiverId"
#define SEQUENCES @"sequences"
#define USER_ID @"user_id"
#define SENDERID @"senderId"
#define MESSSAGETYPE @"messageType"
#define MEDIATYPE @"mediaType"
#define STATE @"state"
#define LENGTH @"length"
#define MESSESION_ID @"mesSesion_sess_id"
#define UT_ID @"ut_id"
#define TEXT @"text"


@interface Message : ORMRecord

@property(nonatomic,retain) NSString *mID;
@property(nonatomic,retain) NSString *receiverId;
@property(nonatomic,retain) NSString *sequences;
@property(nonatomic,retain) NSString *user_id;
@property(nonatomic,retain) NSString *senderId;
@property(nonatomic,retain) NSString *messageType;
@property(nonatomic,retain) NSString *mediaType;
@property(nonatomic,retain) NSString *state;
@property(nonatomic,retain) NSString *length;
@property(nonatomic,retain) NSString *mesSesion_sess_id;
@property(nonatomic,retain) NSString *ut_id;
@property(nonatomic,retain) NSString *text;

-(Message*)initWithData:(NSDictionary*)msgMap msgId:(NSString*)msgid updateTime:(NSDate*) time;
-(Message*)initWithData:(NSDictionary*)msgMap msgId:(NSString*)msgid updateTime:(NSDate*) time seesionID:(NSString*)sessId;

-(BOOL)isSendMine;


-(BOOL)isMine;

@end
